package com.fy.market.trigger.http;

import com.fy.market.activity.service.rule.Test;
import com.fy.market.strategy.service.assemble.IStrategyAwardAssemble;
import com.fy.market.trigger.api.AssembleApi;
import com.fy.market.types.common.reslut.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.fy.market.types.common.reslut.R.ok;


/**
 * 策略奖品控制器
 * @author fwq
 * @date 2025-07-24 10:00
 * @desc 策略奖品控制器
 */
@Slf4j
@Tag(name = "策略奖品装配模块", description = "策略奖品装配接口")
@RestController
@RequestMapping("/assemble")
public class AssembleController implements AssembleApi {

    @Resource
    private IStrategyAwardAssemble iStrategyAwardAssemble;

    @Resource
    private Test test;

    /**
     * 组装抽奖策略
     *
     * @param strategyId 策略ID
     * @return 抽奖策略
     */
    @Override
    @Operation(summary = "组装策略奖品")
    @GetMapping("/assembleStrategyAward")
    public R assembleStrategyAward(@RequestParam("strategyId") Integer strategyId) {
        return iStrategyAwardAssemble.assembleStrategyAward(strategyId);
    }
     /**
      * 测试
      */
     @GetMapping("/test")
     public R test() {
         test.test();
         return ok();
     }
}
